package chapter04;

public class Java02_Object_02 {
    public static void main(String[] args) {
        Teacher t1 = new Teacher();
        t1.name = "张三";
        t1.teacher();

        Student s1 = new Student();
        s1.name = "李四";
        s1.study();

    }
}
class Teacher {
    String name;

    void teacher() {
        System.out.println(name+"老师在讲课");
    }
}
class Student {
    String name;

    void study() {
        System.out.println("学生"+name+"在听课");
    }
}
